#pragma GCC optimize(2)
#include <bits/stdc++.h>
#define F first
#define S second
#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
const int N=2e5+10;
ll b[N];
void solve()
{
	ll n,k;
	cin>>n>>k;
	vector<int> g[n+3];
	
	int head = 1;
	for(int i=1;i<=n;i++)
	{
		head = 1;
		cin>>b[i];
		if(b[i]>n) continue;
		ll d= b[i] - ( (i+b[i]-1)%n+1 );
		if(d<0) d+=n;
		head += d;
//		cout<<head<<' ';
		g[head].push_back(i);
	}
	
	int f=0;
	for(auto it:g[1])
	{
		vector<int> st(n+3,0);
		st[it]=1;
		queue<pii> q;
		q.push({(b[it]+1-1)%n+1,1});
		int d=1;
		while(q.size())
		{
			pii t=q.front();
			q.pop();
			for(auto i:g[t.F])
			{
				if(st[i]==1) 
				{
					f=1;
					break;
				}
				st[i]=1;
				q.push({(b[i]+t.F-1)%n+1 ,t.S+1} );
			}
			d=t.S;
			if(d==k)
			{
				f=1;
			}
			if(f) break;
		}
//		cout<<d<<endl;
		if(f)
		{
			cout<<"YES"<<'\n';
			return ;
		}
	}
	
	cout<<"NO"<<'\n';
}
int main()
{
	IOS;
	int T=1;
	cin>>T;

	while(T--)
	{
		solve();
	}

	return 0;
}

